package com.example.test622

import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.navigation.findNavController
import androidx.navigation.ui.setupWithNavController
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.net.event.Event
import com.example.common.mvi.BaseView
import com.example.common.mvi.BaseViewModel
import com.example.test622.databinding.ActivityMainBinding

@Route(path = "/login/main")
class MainActivity : BaseView<ActivityMainBinding, BaseViewModel<*, *>>() {
	
	
	override fun initView() {
		val navView: BottomNavigationView = binding.navView
		val navController = findNavController(R.id.nav_host_fragment_activity_main)
		navView.setupWithNavController(navController)
	}
	
	override fun initData() {
	
	}
	
	
	@Event("getAdapterSize")
	fun getAdapterSize(n: Int) {
		val badge = binding.navView.getOrCreateBadge(R.id.navigation_home)
		badge.number = n
		badge.isVisible = badge.number != 0
	}
	
}